package com.adfm.ws;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.adfm.bo.Devise;
import com.adfm.bo.EtatTransaction;
import com.adfm.bo.JetonRetour;
import com.adfm.bo.impl.PaiementImpl;

@WebService
public class PaiementWS {

	// DI via Spring
	PaiementImpl banque;

	@WebMethod(exclude = true)
	public void setBanque(PaiementImpl banque) {
		this.banque = banque;
	}

	@WebMethod(operationName = "ouvertureTransaction")
	public JetonRetour ouvertureTransaction(
			@WebParam(name = "somme") double somme,
			@WebParam(name = "devise") Devise devise,
			@WebParam(name = "url") String urlRetour,
			@WebParam(name = "timeoutMinute") Long timeOut) {
		return banque.ouvertureTransaction(somme, devise, urlRetour, timeOut);
	}

	@WebMethod(operationName = "pollingEtat")
	public EtatTransaction pollingEtat(@WebParam(name = "uuidTransaction") String uuidTransaction) {
		return banque.pollingEtat(uuidTransaction);
	}

}